function add() {
	
	var name = $("#name").val();
	var key_man = $("#key_man").val();
	var address = $("#address").val();
	var phone = $("#phone").val();
	var website = $("#website").val();
	var major_busi = $("#major_busi").val();
	var level = $("input[name='level']:checked").val();
	var up_id = $('#up_id').val();
	var lng = $('#lng').val();
	var lat = $('#lat').val();
	
	$.ajax({
      	url: 'company!add.j',
      	data: "name="+name+"&key_man="+key_man+"&address="+address+"&phone_no="+phone+
      	"&website="+website+"&major_busi="+major_busi+"&level="+level+"&up_id="+up_id+"&lng="+lng+"&lat="+lat,
      	type: 'post',
		success: function(msg){
			if(msg.result == "success"){
				commContent = "新增公司信息成功！";
				commTitle = "成功！！";
				showCommWin(commTitle,commContent);
				focusMarker.closeInfoWindow();
			}
		}
	});
}

function modify(){
//	var id = $("#id").val();
	var name = $("#name").val();
	var address = $("#address").val();
	var phone_no = $("#phone_no").val();
	var lng = $('#lng').val();
	var lat = $('#lat').val();
	$.ajax({
      	url: 'company!update.j',
      	data: "name="+name+"&id="+id+"&address="+address+"&phone_no="+phone_no+"&lng="+lng+"&lat="+lat,
      	type: 'post',
			success: function(msg){
				//如果成功
				if(msg.result == "success"){
					if(msg.result == "success"){
						commContent = "修改公司信息成功！";
						commTitle = "成功！！";
						showCommWin(commTitle,commContent);
						focusMarker.closeInfoWindow();
					}
				}
			}
	});
}

function remove(){
	if(confirm( "真的要删除么?")) { 
		var lng = $('#lng').val();
		var lat = $('#lat').val();
		$.ajax({
	      	url: 'company!delete.j',
	      	data: "lng="+lng+"&lat="+lat,
	      	type: 'post',
				success: function(msg){
					//如果成功
					if(msg.result == "success"){
						if(msg.result == "success"){
							commContent = "删除公司信息成功！";
							commTitle = "成功！！";
							showCommWin(commTitle,commContent);
							focusMarker.closeInfoWindow();
							map.removeOverlay(focusMarker);
						}
					}
				}
		});
	}
}

